package com.dxy.df.modules.service.impl;

import com.dxy.df.constants.ConstStrings;
import com.dxy.df.utils.UcBeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.dxy.df.modules.bean.entity.DfLikeEntity;
import com.dxy.df.modules.bean.vo.DfLikeVo;
import com.dxy.df.modules.bean.query.DfLikeQuery;
import com.dxy.df.modules.bean.put.DfLikePut;
import com.dxy.df.modules.dao.DfLikeMapper;
import com.dxy.df.modules.service.DfLikeService;


/**
 * @author biz@dxy.cn
 * @describe 点赞表
 * @date 2019-10-25 16:23:46
 */
@Service
public class DfLikeServiceImpl implements DfLikeService {
	@Autowired
	private DfLikeMapper dfLikeMapper;
	
	@Override
	public DfLikeEntity queryObject(DfLikeQuery query){
		return dfLikeMapper.queryObject(query);
	}
	
	@Override
	public List<DfLikeVo> queryList(DfLikeQuery query){
		return dfLikeMapper.queryList(query);
	}
	
	@Override
	public int queryTotal(DfLikeQuery query){
		return dfLikeMapper.queryTotal(query);
	}
	
	@Override
	public void save(DfLikePut put){
		DfLikeEntity entity =
				UcBeanUtils.copyPropertiesForDDL(put, DfLikeEntity.class, ConstStrings.ADD);
		dfLikeMapper.save(entity);
	}
	
	@Override
	public void update(DfLikePut put){
		DfLikeEntity entity = UcBeanUtils.copyPropertiesForDDL(put, DfLikeEntity.class, "");
		dfLikeMapper.update(entity);
	}
	
	@Override
	public void delete(Integer id){
		dfLikeMapper.delete(id);
	}

	@Override
    public int deleteBatch(Integer[] ids){
		return dfLikeMapper.deleteBatch(ids);
	}

	@Override
	public void deleteLike(String articleId, String createBy) {
		deleteLike(articleId,createBy);
	}

}
